package general.dbClass;

import java.util.ArrayList;

public class DBThumbInfo {
	private int nr;
	private String name;
	public DBThumbInfo(int nr, String name) {
		this.nr = nr;
		this.name = name;
	}

	public int getNr() {
		return nr;
	}

	public String getName() {
		return name;
	}

	
	public boolean equals(DBThumbInfo thumb) {
		if (nr == thumb.getNr()) {
			return true;
		} else {
			return false;
		}
	}

	public String toString(){
		return "pic"+nr;
	}
	
	public static ArrayList<DBThumbInfo> intersect(
			ArrayList<DBThumbInfo> thumbs1, ArrayList<DBThumbInfo> thumbs2) {
		ArrayList<DBThumbInfo> result = new ArrayList<DBThumbInfo>();
		for (int i = 0; i < thumbs1.size(); i++) {
			for (int j = 0; j < thumbs2.size(); j++) {
				if (thumbs1.get(i).equals(thumbs2.get(j))) {
					result.add(thumbs1.get(i));
				}
			}
		}
		return result;
	}
	
}
